/*
 * This file is a part of qloudgen-esb. 
 * You can redistribute qloudgen-esb and/or modify it under the terms of the Lesser GNU General Public License version 3. 
 * qloudgen-esb is distributed WITHOUT ANY WARRANTY. 
 * 
 * See the Lesser GNU General Public License for more details at http://www.gnu.org/licenses/.
 *  
 * Copyright (C) 2014 Qloudgen Technology
*/

package com.qloudgen.csb.test;

import java.util.Random;
import java.util.UUID;

public final class Utils {
	private Utils() {}
	
    public static String sockId() {
    	return UUID.randomUUID().toString().replace("-", "");
    }

	public static String randomString(final int length) {
		String s = new String("abcdefghijklmnopqrstuvwxyz");
		Random r = new Random(); 
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < length; i++) {
			int index = r.nextInt(26);
			sb.append(s.substring(index, index + 1));
		}
		return sb.toString();
	}
}

